function audioSignal = kick_drum(duration , Data, Fs)
%ksData:       
%       sustain: de 0 a 1 (0.8 default)
%       Position: 0(default) a 1
%       Direction: 0(default) a 0.999
%
    frequency=Data.frequency;
    x = zeros(round(Fs*duration), 1);
    delay = round(Fs/frequency);
    
    zi=randn(delay,1)*2-1;
    x=[zi;x(1:end-length(zi))];
    
    x=filter([1-Data.Direction],[1 Data.Direction],x);
    x=filter([1 zeros(1,round(Data.Position*delay))],[1],x);
    
    y=x;
    for k=delay+2:length(x)
        y(k) = x(k)+ (y(k-delay)+y(k-delay-1))*0.5/2;
    end
    note=y;
    note = note-mean(note);
    
    for k=1:length(note)
        note(k)=note(k)*exp(-(1-Data.sustain)*100*k/Fs);
    end
    audioSignal=note;
    if ~strcmp(Data.trueSnare,'none')
        [instrument Finstrument] = wavread(Data.trueSnare);
        instrument=instrument/max(instrument);
        audioSignal=conv(audioSignal,instrument);
    end
    
    audioSignal=audioSignal/max(audioSignal);
    audioSignal=audioSignal';
end
